<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
<form id="permission_edit_form" method="post"
      action="${pageContext.request.contextPath}/admin/permission/update.html">
    <input name="id" type="hidden" value="${requestScope.permission.id}" />
    <div style="width: 350px;margin: 15px;">
        <span class="block input-icon input-icon-right">
        <input type="text" class="form-control" maxlength="50" value="${requestScope.permission.name}"
               placeholder="权限名 "
               name="name"
               datatype="permissionname"
               nullmsg="权限名不能为空"
               errormsg="权限名格式错误" />
        </span>
        <p class="form_prompt">权限名由英文字母组成，以冒号分隔</p>
        <span class="block input-icon input-icon-right">
        <input type="text" class="form-control" maxlength="100" value="${requestScope.permission.description}"
               placeholder="权限描述 "
               name="desc"
               datatype="*"
               nullmsg="权限描述不能为空"
               errormsg="权限描述格式错误">
        </span>
        <p class="form_prompt">权限描述不能超过100个字符</p>
        <div>
            <button type="submit" class="btn btn-sm btn-primary"><i class="icon-save align-top bigger-125"></i>保存</button>
            <a href="${pageContext.request.contextPath}/admin/permission/manage.html" class="btn btn-sm btn-grey"><i class="icon-reply align-top bigger-125"></i>返回</a>
        </div>
    </div>
</form>
<script>
    top.setMenuActionOpen('系统设置','权限管理','编辑权限');
    $('#permission_edit_form').Validform({
        btnSubmit: "#permission_edit_form button[type=submit]",
        showAllError: false,
        postonce: true,
        ajaxPost: false,
        tiptype: function (msg, o, cssctl) {
            if (!o.obj.is("form")) {
                var objtip = o.obj.parent().next(".form_prompt");
                cssctl(objtip, o.type);
                objtip.text(msg);
            }
        },
        beforeSubmit: function (curform) {
            return true;
        }
    });
</script>
</body>
</html>
